package org.soria.getinfo.panels;

import org.soria.getinfo.utils.InfoUtil;
import org.soria.getinfo.utils.PanelUtil;

import javax.swing.*;
import java.util.Map;

public class MemoryPanel extends JPanel {
    public MemoryPanel() {
        this.setLayout(null);
        this.setBorder(PanelUtil.createBorder("内存信息"));
        Map<Integer, Map<String,String>> memInfo = InfoUtil.MEMORY;

        JLabel memNameLabel1 = PanelUtil.createLabel("内存1名称：",15,30);
        this.add(memNameLabel1);
        JLabel memName1 = PanelUtil.createInfoLabel(memInfo.get(0).get("mem_name"),115,30,300);
        this.add(memName1);
        JLabel memSizeLabel1 = PanelUtil.createLabel("内存1大小：",15,50);
        this.add(memSizeLabel1);
        JLabel memSize1 = PanelUtil.createInfoLabel(memInfo.get(0).get("mem_size"),115,50,300);
        this.add(memSize1);
        JLabel memTypeLabel1 = PanelUtil.createLabel("内存1类型：",15,70);
        this.add(memTypeLabel1);
        JLabel memType1 = PanelUtil.createInfoLabel(memInfo.get(0).get("mem_type"),115,70,300);
        this.add(memType1);
        JLabel memSpeedLabel1 = PanelUtil.createLabel("内存1速度：",15,90);
        this.add(memSpeedLabel1);
        JLabel memSpeed1 = PanelUtil.createInfoLabel(memInfo.get(0).get("mem_speed"),115,90,300);
        this.add(memSpeed1);

        JLabel memNameLabel2 = PanelUtil.createLabel("内存2名称：",485,30);
        this.add(memNameLabel2);
        JLabel memName2 = PanelUtil.createInfoLabel(memInfo.get(0).get("mem_name"),585,30,300);
        this.add(memName2);
        JLabel memSizeLabel2 = PanelUtil.createLabel("内存2大小：",485,50);
        this.add(memSizeLabel2);
        JLabel memSize2 = PanelUtil.createInfoLabel(memInfo.get(0).get("mem_size"),585,50,300);
        this.add(memSize2);
        JLabel memTypeLabel2 = PanelUtil.createLabel("内存2类型：",485,70);
        this.add(memTypeLabel2);
        JLabel memType2 = PanelUtil.createInfoLabel(memInfo.get(0).get("mem_type"),585,70,300);
        this.add(memType2);
        JLabel memSpeedLabel2 = PanelUtil.createLabel("内存2速度：",485,90);
        this.add(memSpeedLabel2);
        JLabel memSpeed2 = PanelUtil.createInfoLabel(memInfo.get(0).get("mem_speed"),585,90,300);
        this.add(memSpeed2);
    }
}
